import Vue from 'vue'
import VueRouter from 'vue-router'
import Manage from '../views/Manage'
import User from '../views/User'
import Home from '../views/Home'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'manage',
        component: Manage,
        redirect: '/home',
        // meta: {
            // name: '首页'
        // },
        // component: () => import("../views/Manage.vue")
        children: [
            {
                path: 'home',
                name: 'home',
                component: Home,
                meta: {
                    name: '主页'
                },
            },
            {
                path: 'user',
                name: 'user',
                component: User,
                meta: {
                    name: '文章管理'
                }
            }
        ]
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
